<?php
  // 借阅申请保存
  include_once('../conn.php');
  $book_id = $_POST['book_id'];
  $book_name = $_POST['book_name'];
  $apply_num = $_POST['apply_num'];
  $apply_user = $_SESSION['username'];
  $sql = "insert into apply (book_name, book_id, apply_num, apply_user) values ('$book_name', $book_id, $apply_num, '$apply_user')";
  // echo $sql;
  $result = mysqli_query($conn, $sql);
  if($result) {
    alert('添加成功', 'me_apply_list.php');
  } else {
    alert('添加失败', 'me_apply_new.php');
  }

  mysqli_close($conn);
?>